//version:1.0.0
  window.save = function () {
        let data = window.vueInstance.$children[0].$children[0].$children[0].$children[1].$children[1].$children[0];
        if (!data.$route.query.ticket && !data.$route.query.projid) return;
        data.formValidate(['form']);
        data.customBackFun();
    };
    export default {
        data() {
            return {
                form:{
                    aac001: {
                        value: '',
                        p: 'H'
                    },
                    bae506: {
                        value: '',
                        p: 'H'
                    },
                    lc61aac001: {
                        value: '',
                        p: 'H'
                    },
                    lc61aac003: {
                        value: '',
                        p: 'R'
                    },
                    lc61nl: {
                        value: '',
                        p: 'E'
                    },
                    lc61aac004: {
                        key: '',
                        value: '',
                        p: 'E'
                    },
                     lc61aac005: {
                        key: '',
                        value: '',
                        p: 'E'
                    },
                    lc61aac147: {
                        value: '',
                        p: 'R'
                    },
                    lc61aac067: {
                        value: '',
                        p: 'E'
                    },
                    lc61aae005: {
                        value: '',
                        p: 'E'
                    },
                    lc62aab001: {
                        value: '',
                        p: 'H'
                    },
                    lc62aab004: {
                        value: '',
                        p: 'R'
                    },
                    lc62bab010: {
                        value: '',
                        p: 'E'
                    },
                    lc62aae004: {
                        value: '',
                        p: 'E'
                    },
                    lc62aab013: {
                        value: '',
                        p: 'E'
                    },
                    elc050: {
                        value: '',
                        p: 'E'
                    },
                    ala040: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc060: {
                        key: [],
                        value: []
                    },
                    alc068: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    aae030: {
                        value: '',
                        p: 'R'
                    },
                    aae031: {
                        value: '',
                        p: 'E'
                    },
                    alc059: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc022: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc055: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc056: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc057: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc058: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc060S: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc063: {
                        value: '',
                        p: 'R'
                    },
                    alc022: {
                        value: '',
                        p: 'R'
                    },
                    blc566: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    blc567: {
                        key: '',
                        value: '',
                        p: 'R'
                    },

                },
                show01: false,
                show1: false,
                show2: false,
                show3: false,
                show4: false,
                show5: false,
                show6: false,
                show7: false,

                rules:{
                    lc61aac003: [
                         {required: true, validator: this.$rules.test_noBlank, trigger: 'blur'}

                    ],
                    lc61aac147: [
                         {required: true, validator: this.$rules.test_noBlank, trigger: 'blur'}

                    ],
                    lc62aab004: [
                         {required: true, validator: this.$rules.test_noBlank, trigger: 'blur'}

                    ],
                    ala040: [
                         {required: true, validator: this.$rules.test_noBlank, trigger: 'change'}

                    ],
                    alc060: [
                         {required: true, validator: this.$rules.test_noBlank, trigger: 'blur'}

                    ],
                    alc068: [
                         {required: true, validator: this.$rules.test_noBlank, trigger: 'change'}

                    ],
                    aae030: [
                         {required: true, validator: this.$rules.test_noBlank, trigger: 'blur'}

                    ],
                    alc059: [
                         {required: true, validator: this.$rules.test_noBlank, trigger: 'change'}

                    ],
                    alc022: [
                         {required: true, validator: this.$rules.test_noBlank, trigger: 'change'}

                    ],
                    alc055: [
                         {required: true, validator: this.$rules.test_noBlank, trigger: 'change'}

                    ],
                    alc056: [
                         {required: true, validator: this.$rules.test_noBlank, trigger: 'change'}

                    ],
                    alc057: [
                         {required: true, validator: this.$rules.test_noBlank, trigger: 'change'}

                    ],
                    alc058: [
                         {required: true, validator: this.$rules.test_noBlank, trigger: 'change'}

                    ],
                    alc060S: [
                         {required: true, validator: this.$rules.test_noBlank, trigger: 'change'}

                    ],
                    alc063: [
                         {required: true, validator: this.$rules.test_noBlank, trigger: 'blur'}

                    ],
                    alc022: [
                         {required: true, validator: this.$rules.test_noBlank, trigger: 'blur'}

                    ],
                    blc566: [
                         {required: true, validator: this.$rules.test_noBlank, trigger: 'change'}

                    ],
                    blc567: [
                         {required: true, validator: this.$rules.test_noBlank, trigger: 'change'}

                    ],

                },
                codeTypes:{
                    AAC004:[],
                    AAC005:[],
                    ALA040:[],
                    ALC060:[],
                    ALC068:[],
                    ALC059:[],
                    ALC022:[],
                    ALC055:[],
                    ALC056:[],
                    ALC063:[],
                    BLC566:[],
                    BLC567:[],

                },
                codeTypeFilters:{

                },
                pager: {
	                page: 1,
	                size: 10
            	},
            	total: 0,
            }
        },
        computed: {
            refresh() {
                return localStorage.getItem('refresh') || false;
            },
            functionId() {
                if (this.$store.getters.init.path !== this.$route.path) return;
                if (this.$store.getters.init.mdParam === null || this.$store.getters.init.mdParam === undefined) return;
                if (this.$store.getters.init.mdParam.functionid === undefined) return;
                return this.$store.getters.init.mdParam.functionid;
            },
            backFun() {
                return this.$store.getters.backFun;
            },
            init_show01() {
                if (this.$store.getters.init.path !== this.$route.path)  return;
                return this.$store.getters.init.show01;
            },
            doInitshow01: {
                get: function () {
                    if (this.$store.getters.common === null) return [];
                    if (this.$store.getters.common.path !== this.$route.path) return;
                    return this.$store.getters.common.show01;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },
            init_show1() {
                if (this.$store.getters.init.path !== this.$route.path)  return;
                return this.$store.getters.init.show1;
            },
            doInitshow1: {
                get: function () {
                    if (this.$store.getters.common === null) return [];
                    if (this.$store.getters.common.path !== this.$route.path) return;
                    return this.$store.getters.common.show1;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },
            init_show2() {
                if (this.$store.getters.init.path !== this.$route.path)  return;
                return this.$store.getters.init.show2;
            },
            doInitshow2: {
                get: function () {
                    if (this.$store.getters.common === null) return [];
                    if (this.$store.getters.common.path !== this.$route.path) return;
                    return this.$store.getters.common.show2;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },
            init_show3() {
                if (this.$store.getters.init.path !== this.$route.path)  return;
                return this.$store.getters.init.show3;
            },
            doInitshow3: {
                get: function () {
                    if (this.$store.getters.common === null) return [];
                    if (this.$store.getters.common.path !== this.$route.path) return;
                    return this.$store.getters.common.show3;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },
            init_show4() {
                if (this.$store.getters.init.path !== this.$route.path)  return;
                return this.$store.getters.init.show4;
            },
            doInitshow4: {
                get: function () {
                    if (this.$store.getters.common === null) return [];
                    if (this.$store.getters.common.path !== this.$route.path) return;
                    return this.$store.getters.common.show4;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },
            init_show5() {
                if (this.$store.getters.init.path !== this.$route.path)  return;
                return this.$store.getters.init.show5;
            },
            doInitshow5: {
                get: function () {
                    if (this.$store.getters.common === null) return [];
                    if (this.$store.getters.common.path !== this.$route.path) return;
                    return this.$store.getters.common.show5;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },
            init_show6() {
                if (this.$store.getters.init.path !== this.$route.path)  return;
                return this.$store.getters.init.show6;
            },
            doInitshow6: {
                get: function () {
                    if (this.$store.getters.common === null) return [];
                    if (this.$store.getters.common.path !== this.$route.path) return;
                    return this.$store.getters.common.show6;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },
            init_show7() {
                if (this.$store.getters.init.path !== this.$route.path)  return;
                return this.$store.getters.init.show7;
            },
            doInitshow7: {
                get: function () {
                    if (this.$store.getters.common === null) return [];
                    if (this.$store.getters.common.path !== this.$route.path) return;
                    return this.$store.getters.common.show7;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },
            init_formData() {
                if (this.$store.getters.init.path !== this.$route.path)  return;
                return this.$store.getters.init.form;
            },
            doInitformData: {
                get: function () {
                    if (this.$store.getters.common === null) return [];
                    if (this.$store.getters.common.path !== this.$route.path) return;
                    return this.$store.getters.common.formData;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },
            init_form() {
                if (this.$store.getters.init.path !== this.$route.path)  return;
                return this.$store.getters.init.form;
            },
            doInitform: {
                get: function () {
                    if (this.$store.getters.common === null) return [];
                    if (this.$store.getters.common.path !== this.$route.path) return;
                    return this.$store.getters.common.form;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },

        },
        created() {
            let param = {
                path: this.$route.path,
                codeTypes:this.codeTypes,
                codeTypeFilters: window.btoa(JSON.stringify(this.codeTypeFilters)),
                form:this.form

            };
            if (this.refresh === 'true') {
                this.$store.dispatch('SET_INIT', param);
                sessionStorage.removeItem(this.$route.path);
            }
            if (this.$route.query.keepAlive === undefined) {
                this.$store.dispatch('SET_INIT', param);
            }
        },
        watch: {
            refresh: {
                handler(value) {
                    return value;
                },
            deep: true
            },
            init_show01: {
                handler(value) {
                    if (value == undefined) return;
                    this.getshow01(value);
                },
                deep: true
            },
            doInitshow01: {
                handler(value) {
                    if (value == undefined) return;
                    
                    this.getshow01(value);
                },
                deep: true
            },
            init_show1: {
                handler(value) {
                    if (value == undefined) return;
                    this.getshow1(value);
                },
                deep: true
            },
            doInitshow1: {
                handler(value) {
                    if (value == undefined) return;
                    
                    this.getshow1(value);
                },
                deep: true
            },
            init_show2: {
                handler(value) {
                    if (value == undefined) return;
                    this.getshow2(value);
                },
                deep: true
            },
            doInitshow2: {
                handler(value) {
                    if (value == undefined) return;
                    
                    this.getshow2(value);
                },
                deep: true
            },
            init_show3: {
                handler(value) {
                    if (value == undefined) return;
                    this.getshow3(value);
                },
                deep: true
            },
            doInitshow3: {
                handler(value) {
                    if (value == undefined) return;
                    
                    this.getshow3(value);
                },
                deep: true
            },
            init_show4: {
                handler(value) {
                    if (value == undefined) return;
                    this.getshow4(value);
                },
                deep: true
            },
            doInitshow4: {
                handler(value) {
                    if (value == undefined) return;
                    
                    this.getshow4(value);
                },
                deep: true
            },
            init_show5: {
                handler(value) {
                    if (value == undefined) return;
                    this.getshow5(value);
                },
                deep: true
            },
            doInitshow5: {
                handler(value) {
                    if (value == undefined) return;
                    
                    this.getshow5(value);
                },
                deep: true
            },
            init_show6: {
                handler(value) {
                    if (value == undefined) return;
                    this.getshow6(value);
                },
                deep: true
            },
            doInitshow6: {
                handler(value) {
                    if (value == undefined) return;
                    
                    this.getshow6(value);
                },
                deep: true
            },
            init_show7: {
                handler(value) {
                    if (value == undefined) return;
                    this.getshow7(value);
                },
                deep: true
            },
            doInitshow7: {
                handler(value) {
                    if (value == undefined) return;
                    
                    this.getshow7(value);
                },
                deep: true
            },
            init_formData: {
                handler(value) {
                    if (value == undefined) return;
                    this.getformData(value);
                },
                deep: true
            },
            doInitformData: {
                handler(value) {
                    if (value == undefined) return;
                    
                    this.getformData(value);
                },
                deep: true
            },
            init_form: {
                handler(value) {
                    if (value == undefined) return;
                    this.getform(value);
                },
                deep: true
            },
            doInitform: {
                handler(value) {
                    if (value == undefined) return;
                    
                    this.getform(value);
                },
                deep: true
            },

            backFun: {
                handler(value) {
                    if (value === null) return;
                    this.customBackFun();
                    let backFun = [];
                    backFun = value.split(',');
                    if (backFun.indexOf('rDoInit') >= 0) {
                let codeTypes = {
                    AAC004:[],
                    AAC005:[],
                    ALA040:[],
                    ALC060:[],
                    ALC068:[],
                    ALC059:[],
                    ALC022:[],
                    ALC055:[],
                    ALC056:[],
                    ALC063:[],
                    BLC566:[],
                    BLC567:[],

                };
                let form = {
                    aac001: {
                        value: '',
                        p: 'H'
                    },
                    bae506: {
                        value: '',
                        p: 'H'
                    },
                    lc61aac001: {
                        value: '',
                        p: 'H'
                    },
                    lc61aac003: {
                        value: '',
                        p: 'R'
                    },
                    lc61nl: {
                        value: '',
                        p: 'E'
                    },
                    lc61aac004: {
                        key: '',
                        value: '',
                        p: 'E'
                    },
                     lc61aac005: {
                        key: '',
                        value: '',
                        p: 'E'
                    },
                    lc61aac147: {
                        value: '',
                        p: 'R'
                    },
                    lc61aac067: {
                        value: '',
                        p: 'E'
                    },
                    lc61aae005: {
                        value: '',
                        p: 'E'
                    },
                    lc62aab001: {
                        value: '',
                        p: 'H'
                    },
                    lc62aab004: {
                        value: '',
                        p: 'R'
                    },
                    lc62bab010: {
                        value: '',
                        p: 'E'
                    },
                    lc62aae004: {
                        value: '',
                        p: 'E'
                    },
                    lc62aab013: {
                        value: '',
                        p: 'E'
                    },
                    elc050: {
                        value: '',
                        p: 'E'
                    },
                    ala040: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc060: {
                        key: [],
                        value: []
                    },
                    alc068: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    aae030: {
                        value: '',
                        p: 'R'
                    },
                    aae031: {
                        value: '',
                        p: 'E'
                    },
                    alc059: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc022: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc055: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc056: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc057: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc058: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc060S: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc063: {
                        value: '',
                        p: 'R'
                    },
                    alc022: {
                        value: '',
                        p: 'R'
                    },
                    blc566: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    blc567: {
                        key: '',
                        value: '',
                        p: 'R'
                    },

                };

            let param = {
                path: this.$route.path,
                codeTypes:codeTypes,
                codeTypeFilters: window.btoa(JSON.stringify(this.codeTypeFilters)),
                form:form

            };
                        this.$store.dispatch('SET_INIT', param);
                    }
                }
            }
        },
        mounted() {
            if (this.$store.getters.cacheData === null) return;
            if (this.$store.getters.cacheData[this.$route.path] === undefined)  return;
            if (this.$store.getters.cacheData[this.$route.path].path !== this.$route.path) return;
            if (this.$store.getters.cacheData[this.$route.path].form !== undefined) {
                this.getformData(this.$store.getters.cacheData[this.$route.path].form);
            }
            if (this.$store.getters.cacheData[this.$route.path].form !== undefined) {
                this.getform(this.$store.getters.cacheData[this.$route.path].form);
            }

        },
        beforeRouteLeave(to, from, next) {
            let param = {
                path: this.$route.path,
                codeTypes: this.$store.getters.codeTypes,
                codeTypeFilters: window.btoa(JSON.stringify(this.codeTypeFilters)),
                form:this.form

            };
            if (from) {
                this.$store.dispatch('SET_CACHEDATA', param);
            }
            next();
        },
        methods: {
            getformData(value) {
                this.form = value;
            },
            getform(value) {
                this.form = value;
            },
            getshow01(value) {
                this.show01 = value;
            },
            getshow1(value) {
                this.show1 = value;
            },
            getshow2(value) {
                this.show2 = value;
            },
            getshow3(value) {
                this.show3 = value;
            },
            getshow4(value) {
                this.show4 = value;
            },
            getshow5(value) {
                this.show5 = value;
            },
            getshow6(value) {
                this.show6 = value;
            },
            getshow7(value) {
                this.show7 = value;
            },


            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);
            },
            handleCurrentChange(val) {
                console.log(`当前页: ${val}`);
            },
            handleEdit(id) {
                this.dialogFormVisible = true;
            },
            deleteCurrentRow(val){
                this.tableData.Data.splice(this.tableData.Data.findIndex((value,index,ary) => value == val),1);
            },

            customBackFun(){//自定义方法体
},
        },
    }
